﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.announcements {

    public class AnnouncementManager {

        protected var m_announcements:Array;

        public function AnnouncementManager(){
            this.m_announcements = Global.gameSettings.getAnnouncements();
        }
        public function getNextAnnouncement():AnnouncementData{
            var _local1:AnnouncementData;
            var _local2:AnnouncementData;
            for each (_local2 in this.m_announcements) {
                if (((_local2.hasNotSeen) && (_local2.validate()))){
                    if (((_local1) && ((_local1.priority >= _local2.priority)))){
                    } else {
                        _local1 = _local2;
                    };
                };
            };
            return (_local1);
        }
        public function getAnnouncementById(_arg1:String):AnnouncementData{
            var _local2:AnnouncementData;
            for each (_local2 in this.m_announcements) {
                if (_local2.id != _arg1){
                } else {
                    if (((_local2.hasNotSeen) && (_local2.validate()))){
                        return (_local2);
                    };
                    break;
                };
            };
            return (null);
        }

    }
}//package Classes.announcements 
